<!DOCTYPE html>
<html ng-app="myApp">
	<head>
		<meta charset="utf-8">
		<title>Simple app</title>
		<script type="text/javascript" src="../angular.min.js"></script>
	</head>
	<body  ng-controller="MyCtrl">
		<h4>
			The Simplest adding machine ever
		</h4>
		<button ng-click="add(1)">Add</button>
		<a ng-click="subtract(1)">Sutract</a>
		<h4>
			Current count:{{counter}}
		</h4>
		<script type="text/javascript" src="../jquery-1.11.0.js"></script>
		<script type="text/javascript">
		//使用angular.js中的事件
		var app = angular.module('myApp',[]);
		app.controller('MyCtrl',function($scope){
			$scope.counter = 0;
			//声明处理click事件的方法
			$scope.add = function(a){
				$scope.counter += a;
			}
			$scope.subtract = function(s){
				$scope.counter -= s;
			}
		})
		</script>
	</body>
</html>
